<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
var obj = {};

obj.irum = "Ryu";
obj.kor = 90;
obj.math = 70;
obj.eng = 40;
obj.sum = obj.kor + obj.math + obj.eng;  

document.write("<li>name : " + obj.irum);
document.write("<li> kor : " + obj.kor);
document.write("<li>math : " + obj.math);
document.write("<li> eng : " + obj.eng);
document.write("<li> sum : " + obj.sum);

var score = {};
score.setIrum = function(irum){ this.irum = irum;};
score.setKor = function(k){ this.kor = k;};
score.setEng = function(e){ this.eng = e;};
score.setMath = function(m){ this.math = m;};
score.Compute = function(){ this.sum = this.kor + this.eng + this.math;};

score.getIrum = function(){ return this.irum;};
score.getKor = function(){ return this.kor;};
score.getEng = function(){ return this.eng;};
score.getMath = function(){ return this.math;};
score.getSum = function(){ return this.sum;};

score.setIrum("jihoon");
score.setKor(60);
score.setEng(70);
score.setMath(90);
score.Compute();

document.write("<hr/>");
document.write("<li>Irum : " + score.getIrum());
document.write("<li>kor : " + score.getKor());
document.write("<li>eng : " + score.getEng());
document.write("<li>math : " + score.getMath());
document.write("<li>sum : " + score.getSum());

function Score(irum, kor, eng, math){
	this.irum = irum;
	this.kor = kor;
	this.eng = eng;
	this.math = math;
	
	this.setIrum = function(irum){ this.irum = irum;};
	this.setKor = function(k){ this.kor = k;};
	this.setEng = function(e){ this.eng = e;};
	this.setMath = function(m){ this.math = m;};
	this.compute = function(){ this.sum = this.kor + this.eng + this.math;};

	this.getIrum = function(){ return this.irum;};
	this.getKor = function(){ return this.kor;};
	this.getEng = function(){ return this.eng;};
	this.getMath = function(){ return this.math;};
	this.getSum = function(){ return this.sum;};
	
	this.toString = function(){
		document.write(this.irum + "&nbsp;&nbsp;");
		document.write(this.kor + "&nbsp;&nbsp;");
		document.write(this.eng + "&nbsp;&nbsp;");
		document.write(this.math + "&nbsp;&nbsp;");
		document.write(this.sum + "<br/>");
	}
}

document.write("<hr/>");

s = new Score('Ryu', 100, 100, 80);
s.compute();
s.toString();

s2 = new Score("lee", 60, 70, 50);
s2.compute();
s2.toString();
</script>
</head>
<body>
<input type="text" class="text" onfocus="this.value='';" value="아이디" />
</body>
</html>